<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>观察者模式经典应用之事件监听</title>
</head>
<body>
    <div id="clickBtn">click</div>
    <script>
        let btn = document.getElementById('clickBtn');
        btn.addEventListener('click',function () { 
            console.log('click');
         })
    </script>
</body>
</html>